package cc.orange.adapter;

import android.view.View;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.text.DecimalFormat;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import cc.orange.R;
import cc.orange.entity.MsgInfosVideoEntity;
import cc.orange.utils.CircleImageView;
import demo.smart.access.xutlis.util.ZXScreenUtil;


/**
 * Created by CM on 2022/10/25.
 */

public class RankAdapter extends BaseQuickAdapter<MsgInfosVideoEntity.Data, BaseViewHolder> {

    public RankAdapter(@Nullable List<MsgInfosVideoEntity.Data> data) {
        super(R.layout.item_ranking, data);
    }


    @Override
    protected void convert(@NonNull BaseViewHolder helper, MsgInfosVideoEntity.Data item) {

        CircleImageView item_ranking_img2 = helper.getView(R.id.item_ranking_img2);
        Glide.with(mContext).load(item.getPhoto())
                .into(item_ranking_img2);
        int i = helper.getLayoutPosition() + 4;
        helper.setText(R.id.item_ranking_text1,""+i);
        helper.setText(R.id.item_ranking_text2,""+item.getWomanName());
        helper.setText(R.id.item_ranking_text3,""+item.getSignature());
        int i1 = getData().size() - helper.getLayoutPosition();
        double v = i1 * 1.67;
        helper.setText(R.id.item_ranking_text4,""+new DecimalFormat("0.00").format(v)+"w");
    }


   public interface ItemClickTalk{
        void itemClickTalk(int position);
   }
}
